/* ============ 徽章容器 ============ */

.badge-wrapper {
    position: relative;
    display: inline-flex;
}

.badge-wrapper.badge-top-right {
    justify-content: flex-end;
}

.badge-wrapper.badge-top-left {
    justify-content: flex-start;
}

.badge-wrapper.badge-bottom-right {
    justify-content: flex-end;
}

.badge-wrapper.badge-bottom-left {
    justify-content: flex-start;
}

/* ============ 徽章 ============ */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
}

.badge.badge-default {
    background: var(--primary-color);
}

.badge.badge-success {
    background: #52c41a;
}

.badge.badge-error {
    background: #ff4d4f;
}

.badge.badge-warning {
    background: #faad14;
}

.badge.badge-info {
    background: #1890ff;
}

/* ============ 大小 ============ */

.badge.badge-small {
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    padding: 0 2px;
}

.badge.badge-medium {
    min-width: 20px;
    height: 20px;
    font-size: 12px;
    padding: 0 4px;
}

.badge.badge-large {
    min-width: 24px;
    height: 24px;
    font-size: 14px;
    padding: 0 6px;
}

/* ============ 文本 ============ */

.badge-text {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge.badge-small .badge-text {
    max-width: 30px;
}

.badge.badge-medium .badge-text {
    max-width: 40px;
}

.badge.badge-large .badge-text {
    max-width: 50px;
}

/* ============ 计数 ============ */

.badge-count {
    display: inline-block;
    white-space: nowrap;
}

/* ============ 点 ============ */

.badge.badge-dot {
    min-width: auto;
    height: auto;
    padding: 0;
    border-radius: 50%;
}

.badge-dot-inner {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.badge.badge-small.badge-dot .badge-dot-inner {
    width: 6px;
    height: 6px;
}

.badge.badge-large.badge-dot .badge-dot-inner {
    width: 10px;
    height: 10px;
}

/* ============ 响应式 ============ */

@media (max-width: 768px) {
    .badge.badge-medium {
        min-width: 18px;
        height: 18px;
        font-size: 11px;
    }

    .badge.badge-large {
        min-width: 22px;
        height: 22px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .badge.badge-small {
        min-width: 14px;
        height: 14px;
        font-size: 9px;
    }

    .badge.badge-medium {
        min-width: 16px;
        height: 16px;
        font-size: 10px;
    }

    .badge.badge-large {
        min-width: 20px;
        height: 20px;
        font-size: 12px;
    }
}
